<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>账户管理</title>

</head>
<body>
<div class="main">
<div class="main_title"><b>你当前的位置</b>：账户管理-<s:if test="user.id != null">修改</s:if><s:else>新增</s:else></div>
<s:form action="addOrUpdate!addOrUpdate.action" namespace="/user" >
	<table align="center"  cellpadding="1" cellspacing="1" class="tablelist">

		<s:if test="user.id != null">
			<s:hidden name="user.id"/>
		</s:if>
		<s:if test="hasErrors()">
			<s:if test="hasFieldErrors()">
				<tr align="center">
					<td class="textError"><font color="red" size="4"><s:fielderror/></font></td>
					<td class="tableHeader2"></td>
				</tr>
			</s:if>
			<s:if test="hasActionErrors">
				<tr align="center">
					<td class="textError"><font color="blue"><s:actionerror/></font></td>
					<td class="tableHeader2"></td>
				</tr>
			</s:if>	
		</s:if>
		<tr class="listr2">
	        <td width="30%" align="right" class="listr6"><span class="fontred">*</span><s:label>账户名 </s:label></td>
			<td align="left" class="listr5"><s:textfield name="user.name" size="30" validate="{type:'required'}" cssStyle="width:154px; border:1px solid #7F9DB9; height:16px;padding-top:2px;margin-top:2px"></s:textfield></td>
		</tr>
		<tr class="listr2">
	        <td align="right" class="listr6"><span class="fontred">*</span><s:label>密码 </s:label></td>
			<td align="left" class="listr5"><s:password name="user.pwd" size="30"  validate="{type:'required'}" cssStyle="width:154px; border:1px solid #7F9DB9; height:16px;padding-top:2px;margin-top:2px"></s:password> （这里设置的密码为系统本地密码，为6-20位数字或字母）</td>
		</tr>
		<tr class="listr2">
	        <td align="right" class="listr6"><span class="fontred">*</span><s:label>姓名 </s:label></td>
			<td align="left" class="listr5"><s:textfield name="user.userInfo.name" size="30" validate="{type:'required'}" cssStyle="width:154px; border:1px solid #7F9DB9; height:16px;padding-top:2px;margin-top:2px"></s:textfield></td>
		</tr>
		<tr class="listr2" style="display:none">
	        <td align="right" class="listr6"><span class="fontred">*</span><s:label>账户类别 </s:label></td>
			<td align="left" class="listr5"><s:select name="user.userType" id="accountType" list="userTypes" cssClass="searchSelect"/></td>
		</tr>
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>邮箱 </s:label></td>
			<td align="left" class="listr5"><s:textfield name="user.userInfo.email" size="30" cssClass="searchInput"></s:textfield> </td>
		</tr>
		<s:if test="user.id != null">
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>是否启用 </s:label></td>
			<td align="left" class="listr5"><s:radio name="user.enabled" list="#{true:'是',false:'否'}"></s:radio></td>
		</tr>
		
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>是否锁定 </s:label></td>
			<td align="left" class="listr5"><s:radio name="user.locked" list="#{true:'是',false:'否'}"></s:radio></td>
		</tr>
		
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>是否过期 </s:label></td>
			<td align="left" class="listr5"><s:radio name="user.exipred" list="#{true:'是',false:'否'}"></s:radio></td>
		</tr>
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>密码是否过期 </s:label></td>
			<td align="left" class="listr5"><s:radio name="user.passwordexipred"  list="#{true:'是',false:'否'}"></s:radio></td>
		</tr>
		</s:if>
		<s:else>
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>是否启用 </s:label></td>
			<td align="left" class="listr5"><s:radio name="user.enabled" list="#{true:'是',false:'否'}" value="true"></s:radio></td>
		</tr>
		
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>是否锁定 </s:label></td>
			<td align="left" class="listr5"><s:radio name="user.locked" list="#{true:'是',false:'否'}" value="false"></s:radio></td>
		</tr>
		
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>是否过期 </s:label></td>
			<td align="left" class="listr5"><s:radio name="user.exipred" list="#{true:'是',false:'否'}" value="false"></s:radio></td>
		</tr>
		<tr class="listr2">
	        <td align="right" class="listr6"><s:label>密码是否过期 </s:label></td>
			<td align="left" class="listr5"><s:radio name="user.passwordexipred"  list="#{true:'是',false:'否'}" value="false"></s:radio></td>
		</tr>
		</s:else>
		<tr class="listr4">    		
	    	<td colspan="2">
				<s:submit cssClass="btn" onmouseover="this.className='btn_hover'" onmouseout="this.className='btn'" value="确定" ></s:submit>
				<input name="reset" type="reset" class="btn" onmouseover="this.className='btn_hover'" onmouseout="this.className='btn'" value="重 置" />
				<input name="back" type="button" class="btn" onmouseover="this.className='btn_hover'" onmouseout="this.className='btn'" value="返回" onclick="location.href='user!listUserPage.action'" />
	   		 </td>
   		 </tr>
	</table>
	
</s:form>
</div>
</body>
</html>